package cn.iocoder.an.module.business.dal.mysql.maintenanceinformation;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.maintenanceinformation.MaintenanceInformationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.maintenanceinformation.vo.*;

/**
 * 维保商档案 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface MaintenanceInformationMapper extends BaseMapperX<MaintenanceInformationDO> {

    default PageResult<MaintenanceInformationDO> selectPage(MaintenanceInformationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MaintenanceInformationDO>()
                .likeIfPresent(MaintenanceInformationDO::getEnterpriseName, reqVO.getEnterpriseName())
                .likeIfPresent(MaintenanceInformationDO::getSimpleName, reqVO.getSimpleName())
                .likeIfPresent(MaintenanceInformationDO::getLegalRepresentative, reqVO.getLegalRepresentative())
                .likeIfPresent(MaintenanceInformationDO::getContactPerson, reqVO.getContactPerson())
                .eqIfPresent(MaintenanceInformationDO::getStatus, reqVO.getStatus())
                .orderByDesc(MaintenanceInformationDO::getId));
    }

}